<!DOCTYPE html>
<html lang="en">
<!--<link th:href="@{/css/bootstrap.css}" rel="stylesheet">-->
<script src="/js/jquery-1.8.2.min.js"></script>
<script src="/js/npm.js"></script>
<script src="/layer/layer.js"></script>

<script>
    $(function(){
        var id = [[${param.id}]];
        $.post(
            "updateDate",
            {id:id},
            function(obj){
              $("[name=title]").val(obj.title);
                $("[name=status]").val(obj.status);
                $("[name=id]").val(id);

            },"json"
        )

    })
    function toupdate(){
        $.post(
            "updateItem",
            $("#save").serialize(),
            function(obj){
                if (obj){
                    layer.close(layer.index);
                    window.parent.location.reload();
                }else {
                   layer.alert("失败");
                }
            },"json"
        )
    }
</script>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body >
<form id="save">
        <p>
            商品名称<input type="text" name="title"> <input type="text" name="id">
        </p>
        <p>
            商品状态<input type="text" name="status">
        </p>

    <button onclick="toupdate()" class="btn btn-prim">提交</button>
</table>
</form>
</body>
</html>